3.4.37 \(\int \frac {\cos ^2(c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx\) [337]

Optimal. Leaf size=146 \[ -\frac {5 i \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{8 \sqrt {2} \sqrt {a} d}+\frac {5 i a}{12 d (a+i a \tan (c+d x))^{3/2}}-\frac {i a^2}{2 d (a-i a \tan (c+d x)) (a+i a \tan (c+d x))^{3/2}}+\frac {5 i}{8 d \sqrt {a+i a \tan (c+d x)}} \]

[Out]

-5/16*I*arctanh(1/2*(a+I*a*tan(d*x+c))^(1/2)*2^(1/2)/a^(1/2))/d*2^(1/2)/a^(1/2)+5/8*I/d/(a+I*a*tan(d*x+c))^(1/
2)+5/12*I*a/d/(a+I*a*tan(d*x+c))^(3/2)-1/2*I*a^2/d/(a-I*a*tan(d*x+c))/(a+I*a*tan(d*x+c))^(3/2)

________________________________________________________________________________________

Rubi [A]
time = 0.07, antiderivative size = 146, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.192, Rules used = {3568, 44, 53, 65, 212} \begin {gather*} -\frac {i a^2}{2 d (a-i a \tan (c+d x)) (a+i a \tan (c+d x))^{3/2}}+\frac {5 i a}{12 d (a+i a \tan (c+d x))^{3/2}}+\frac {5 i}{8 d \sqrt {a+i a \tan (c+d x)}}-\frac {5 i \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{8 \sqrt {2} \sqrt {a} d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]^2/Sqrt[a + I*a*Tan[c + d*x]],x]

[Out]

(((-5*I)/8)*ArcTanh[Sqrt[a + I*a*Tan[c + d*x]]/(Sqrt[2]*Sqrt[a])])/(Sqrt[2]*Sqrt[a]*d) + (((5*I)/12)*a)/(d*(a
+ I*a*Tan[c + d*x])^(3/2)) - ((I/2)*a^2)/(d*(a - I*a*Tan[c + d*x])*(a + I*a*Tan[c + d*x])^(3/2)) + ((5*I)/8)/(
d*Sqrt[a + I*a*Tan[c + d*x]])

Rule 44

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(a + b*x)^(m + 1)*((c + d*x)^(n + 1
)/((b*c - a*d)*(m + 1))), x] - Dist[d*((m + n + 2)/((b*c - a*d)*(m + 1))), Int[(a + b*x)^(m + 1)*(c + d*x)^n,
x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, -1] &&  !IntegerQ[n] && LtQ[n, 0]

Rule 53

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(a + b*x)^(m + 1)*((c + d*x)^(n + 1
)/((b*c - a*d)*(m + 1))), x] - Dist[d*((m + n + 2)/((b*c - a*d)*(m + 1))), Int[(a + b*x)^(m + 1)*(c + d*x)^n,
x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && LtQ[m, -1] &&  !(LtQ[n, -1] && (EqQ[a, 0] || (NeQ[
c, 0] && LtQ[m - n, 0] && IntegerQ[n]))) && IntLinearQ[a, b, c, d, m, n, x]

Rule 65

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 3568

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rubi steps

\begin {align*} \int \frac {\cos ^2(c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx &=-\frac {\left (i a^3\right ) \text {Subst}\left (\int \frac {1}{(a-x)^2 (a+x)^{5/2}} \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=-\frac {i a^2}{2 d (a-i a \tan (c+d x)) (a+i a \tan (c+d x))^{3/2}}-\frac {\left (5 i a^2\right ) \text {Subst}\left (\int \frac {1}{(a-x) (a+x)^{5/2}} \, dx,x,i a \tan (c+d x)\right )}{4 d}\\ &=\frac {5 i a}{12 d (a+i a \tan (c+d x))^{3/2}}-\frac {i a^2}{2 d (a-i a \tan (c+d x)) (a+i a \tan (c+d x))^{3/2}}-\frac {(5 i a) \text {Subst}\left (\int \frac {1}{(a-x) (a+x)^{3/2}} \, dx,x,i a \tan (c+d x)\right )}{8 d}\\ &=\frac {5 i a}{12 d (a+i a \tan (c+d x))^{3/2}}-\frac {i a^2}{2 d (a-i a \tan (c+d x)) (a+i a \tan (c+d x))^{3/2}}+\frac {5 i}{8 d \sqrt {a+i a \tan (c+d x)}}-\frac {(5 i) \text {Subst}\left (\int \frac {1}{(a-x) \sqrt {a+x}} \, dx,x,i a \tan (c+d x)\right )}{16 d}\\ &=\frac {5 i a}{12 d (a+i a \tan (c+d x))^{3/2}}-\frac {i a^2}{2 d (a-i a \tan (c+d x)) (a+i a \tan (c+d x))^{3/2}}+\frac {5 i}{8 d \sqrt {a+i a \tan (c+d x)}}-\frac {(5 i) \text {Subst}\left (\int \frac {1}{2 a-x^2} \, dx,x,\sqrt {a+i a \tan (c+d x)}\right )}{8 d}\\ &=-\frac {5 i \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{8 \sqrt {2} \sqrt {a} d}+\frac {5 i a}{12 d (a+i a \tan (c+d x))^{3/2}}-\frac {i a^2}{2 d (a-i a \tan (c+d x)) (a+i a \tan (c+d x))^{3/2}}+\frac {5 i}{8 d \sqrt {a+i a \tan (c+d x)}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.74, size = 126, normalized size = 0.86 \begin {gather*} -\frac {i e^{-2 i (c+d x)} \left (\sqrt {1+e^{2 i (c+d x)}} \left (-2-14 e^{2 i (c+d x)}+3 e^{4 i (c+d x)}\right )+15 e^{3 i (c+d x)} \sinh ^{-1}\left (e^{i (c+d x)}\right )\right )}{24 d \sqrt {1+e^{2 i (c+d x)}} \sqrt {a+i a \tan (c+d x)}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]^2/Sqrt[a + I*a*Tan[c + d*x]],x]

[Out]

((-1/24*I)*(Sqrt[1 + E^((2*I)*(c + d*x))]*(-2 - 14*E^((2*I)*(c + d*x)) + 3*E^((4*I)*(c + d*x))) + 15*E^((3*I)*
(c + d*x))*ArcSinh[E^(I*(c + d*x))]))/(d*E^((2*I)*(c + d*x))*Sqrt[1 + E^((2*I)*(c + d*x))]*Sqrt[a + I*a*Tan[c
+ d*x]])

________________________________________________________________________________________

Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 334 vs. \(2 (114 ) = 228\).
time = 5.15, size = 335, normalized size = 2.29

method result size
default \(\frac {\sqrt {\frac {a \left (i \sin \left (d x +c \right )+\cos \left (d x +c \right )\right )}{\cos \left (d x +c \right )}}\, \left (32 i \left (\cos ^{4}\left (d x +c \right )\right )-15 i \cos \left (d x +c \right ) \arctan \left (\frac {\left (-i \cos \left (d x +c \right )+\sin \left (d x +c \right )+i\right ) \sqrt {2}}{2 \sin \left (d x +c \right ) \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}}\right ) \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sqrt {2}+32 \sin \left (d x +c \right ) \left (\cos ^{3}\left (d x +c \right )\right )-15 \sin \left (d x +c \right ) \arctan \left (\frac {\left (-i \cos \left (d x +c \right )+\sin \left (d x +c \right )+i\right ) \sqrt {2}}{2 \sin \left (d x +c \right ) \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}}\right ) \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sqrt {2}-15 i \arctan \left (\frac {\left (-i \cos \left (d x +c \right )+\sin \left (d x +c \right )+i\right ) \sqrt {2}}{2 \sin \left (d x +c \right ) \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}}\right ) \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sqrt {2}+20 i \left (\cos ^{2}\left (d x +c \right )\right )+60 \sin \left (d x +c \right ) \cos \left (d x +c \right )\right )}{96 d a}\) \(335\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^2/(a+I*a*tan(d*x+c))^(1/2),x,method=_RETURNVERBOSE)

[Out]

1/96/d*(a*(I*sin(d*x+c)+cos(d*x+c))/cos(d*x+c))^(1/2)*(32*I*cos(d*x+c)^4-15*I*cos(d*x+c)*arctan(1/2*(-I*cos(d*
x+c)+sin(d*x+c)+I)/sin(d*x+c)/(-2*cos(d*x+c)/(1+cos(d*x+c)))^(1/2)*2^(1/2))*(-2*cos(d*x+c)/(1+cos(d*x+c)))^(1/
2)*2^(1/2)+32*sin(d*x+c)*cos(d*x+c)^3-15*sin(d*x+c)*arctan(1/2*(-I*cos(d*x+c)+sin(d*x+c)+I)/sin(d*x+c)/(-2*cos
(d*x+c)/(1+cos(d*x+c)))^(1/2)*2^(1/2))*(-2*cos(d*x+c)/(1+cos(d*x+c)))^(1/2)*2^(1/2)-15*I*arctan(1/2*(-I*cos(d*
x+c)+sin(d*x+c)+I)/sin(d*x+c)/(-2*cos(d*x+c)/(1+cos(d*x+c)))^(1/2)*2^(1/2))*(-2*cos(d*x+c)/(1+cos(d*x+c)))^(1/
2)*2^(1/2)+20*I*cos(d*x+c)^2+60*sin(d*x+c)*cos(d*x+c))/a

________________________________________________________________________________________

Maxima [A]
time = 0.50, size = 138, normalized size = 0.95 \begin {gather*} \frac {i \, {\left (15 \, \sqrt {2} \sqrt {a} \log \left (-\frac {\sqrt {2} \sqrt {a} - \sqrt {i \, a \tan \left (d x + c\right ) + a}}{\sqrt {2} \sqrt {a} + \sqrt {i \, a \tan \left (d x + c\right ) + a}}\right ) + \frac {4 \, {\left (15 \, {\left (i \, a \tan \left (d x + c\right ) + a\right )}^{2} a - 20 \, {\left (i \, a \tan \left (d x + c\right ) + a\right )} a^{2} - 8 \, a^{3}\right )}}{{\left (i \, a \tan \left (d x + c\right ) + a\right )}^{\frac {5}{2}} - 2 \, {\left (i \, a \tan \left (d x + c\right ) + a\right )}^{\frac {3}{2}} a}\right )}}{96 \, a d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2/(a+I*a*tan(d*x+c))^(1/2),x, algorithm="maxima")

[Out]

1/96*I*(15*sqrt(2)*sqrt(a)*log(-(sqrt(2)*sqrt(a) - sqrt(I*a*tan(d*x + c) + a))/(sqrt(2)*sqrt(a) + sqrt(I*a*tan
(d*x + c) + a))) + 4*(15*(I*a*tan(d*x + c) + a)^2*a - 20*(I*a*tan(d*x + c) + a)*a^2 - 8*a^3)/((I*a*tan(d*x + c
) + a)^(5/2) - 2*(I*a*tan(d*x + c) + a)^(3/2)*a))/(a*d)

________________________________________________________________________________________

Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 271 vs. \(2 (105) = 210\).
time = 0.37, size = 271, normalized size = 1.86 \begin {gather*} \frac {{\left (-15 i \, \sqrt {\frac {1}{2}} a d \sqrt {\frac {1}{a d^{2}}} e^{\left (3 i \, d x + 3 i \, c\right )} \log \left (4 \, {\left (\sqrt {2} \sqrt {\frac {1}{2}} {\left (a d e^{\left (2 i \, d x + 2 i \, c\right )} + a d\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {1}{a d^{2}}} + a e^{\left (i \, d x + i \, c\right )}\right )} e^{\left (-i \, d x - i \, c\right )}\right ) + 15 i \, \sqrt {\frac {1}{2}} a d \sqrt {\frac {1}{a d^{2}}} e^{\left (3 i \, d x + 3 i \, c\right )} \log \left (-4 \, {\left (\sqrt {2} \sqrt {\frac {1}{2}} {\left (a d e^{\left (2 i \, d x + 2 i \, c\right )} + a d\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {1}{a d^{2}}} - a e^{\left (i \, d x + i \, c\right )}\right )} e^{\left (-i \, d x - i \, c\right )}\right ) + \sqrt {2} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} {\left (-3 i \, e^{\left (6 i \, d x + 6 i \, c\right )} + 11 i \, e^{\left (4 i \, d x + 4 i \, c\right )} + 16 i \, e^{\left (2 i \, d x + 2 i \, c\right )} + 2 i\right )}\right )} e^{\left (-3 i \, d x - 3 i \, c\right )}}{48 \, a d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2/(a+I*a*tan(d*x+c))^(1/2),x, algorithm="fricas")

[Out]

1/48*(-15*I*sqrt(1/2)*a*d*sqrt(1/(a*d^2))*e^(3*I*d*x + 3*I*c)*log(4*(sqrt(2)*sqrt(1/2)*(a*d*e^(2*I*d*x + 2*I*c
) + a*d)*sqrt(a/(e^(2*I*d*x + 2*I*c) + 1))*sqrt(1/(a*d^2)) + a*e^(I*d*x + I*c))*e^(-I*d*x - I*c)) + 15*I*sqrt(
1/2)*a*d*sqrt(1/(a*d^2))*e^(3*I*d*x + 3*I*c)*log(-4*(sqrt(2)*sqrt(1/2)*(a*d*e^(2*I*d*x + 2*I*c) + a*d)*sqrt(a/
(e^(2*I*d*x + 2*I*c) + 1))*sqrt(1/(a*d^2)) - a*e^(I*d*x + I*c))*e^(-I*d*x - I*c)) + sqrt(2)*sqrt(a/(e^(2*I*d*x
 + 2*I*c) + 1))*(-3*I*e^(6*I*d*x + 6*I*c) + 11*I*e^(4*I*d*x + 4*I*c) + 16*I*e^(2*I*d*x + 2*I*c) + 2*I))*e^(-3*
I*d*x - 3*I*c)/(a*d)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\cos ^{2}{\left (c + d x \right )}}{\sqrt {i a \left (\tan {\left (c + d x \right )} - i\right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**2/(a+I*a*tan(d*x+c))**(1/2),x)

[Out]

Integral(cos(c + d*x)**2/sqrt(I*a*(tan(c + d*x) - I)), x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2/(a+I*a*tan(d*x+c))^(1/2),x, algorithm="giac")

[Out]

integrate(cos(d*x + c)^2/sqrt(I*a*tan(d*x + c) + a), x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\cos \left (c+d\,x\right )}^2}{\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)^2/(a + a*tan(c + d*x)*1i)^(1/2),x)

[Out]

int(cos(c + d*x)^2/(a + a*tan(c + d*x)*1i)^(1/2), x)

________________________________________________________________________________________